#!/usr/bin/python
# -*- coding: utf-8 -*-
# Description: Visitor counter
# Create at 2008-12-3 下午10:22:45
# Author: MK2[fengmk2@gmail.com]
"""docstrings
"""

from net4.models import VisitRecord

class VisitCounter(object):
    """Middleware that gets various objects from the
    request object and saves them in thread local storage."""
    def process_response(self, request, response):
        if 'site_media/' not in request.path:
            visit_record = VisitRecord()
            visit_record.record(request, response)
        return response